<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="d" uri="http://dgg.net/jsp/jstl/core" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>驳回订单</title>
    <c:import url="../../header.jsp"/>
</head>
<body>
<p  id="timeout" name="timeout" hidden data-timeout="${TIME_OUT}" ></p>
<div class="content-warp">
    <div class="screen-tab-warp">
        <ul class="screen-tab">
            <li class="active tab-switch" data-target="4"><a href="javascript:void(0)">退单驳回</a></li>
            <li class="tab-switch" data-target="5"><a href="javascript:void(0)">废单驳回</a></li>
        </ul>
    </div>
    <div id="rejectedIncloud"></div>
</div>
</div>
<c:import url="../../footer.jsp"/>
<script>
    var timeout = '${TIME_OUT}';
    var rejectedOrder = {
        "list":sysInfo.basePath +"/all_order/all_Order_json.do",//分页数据
        "rejectedtd":sysInfo.basePath +"/all_order/back.html",
        "rejectedfd":sysInfo.basePath +"/all_order/abandoned.html",
        "timeName" : "退单时间",
        "reasonName" : "退单原因"
    };
    var tables;
    dggui.use(['table','select2','distpicker','dggdate'], function (){
        var select2 = dggui.select2;
        var distpicker=dggui.distpicker;
        var dggdate = dggui.dggdate;
        var table = dggui.table;

        tuidan();
        $(".screen-tab li").click(function(){
            //原本状态下选项卡的值
            var target = $(".active").attr("data-target");
            //切换选项卡样式
            $(this).addClass("active").siblings().removeClass("active");
            //获取选中元素的下标
            var index = $(this).attr("data-target");
            $("#completeState").val(index);
            if(index == 4){
                //$("#changeRejectedTimeName").text("退单");
                $("#hiddenType").val("0");
            }else if(index == 5){
                //$("#changeRejectedTimeName").text("废单");
                $("#hiddenType").val("1");
            }
            if (target != index){
                //如果不相等说明点击的不是当前，所以要重新加载
                if(index == 4){
                    tuidan();
                }else if(index == 5){
                    feidan();
                }
            }
        });

        function feidan(){
            $.ajax({
                url: rejectedOrder.rejectedfd,
                dataType: 'html',
                success:function(html){
                    $("#rejectedIncloud").html(html);
                    //初始化所属生产事业部
                    syb("#productOrgId");
                    select2.render({
                        placeholder: "请选择",
                        elem: $('#productOrgId'),
                        allowClear: true,
                        width: "190px"
                    });
                    //初始化订单状态
                    /*commonTreeBookCode("#orderStatus", "RZSCORDER_STATUS", 1, 1, 1, true);
                    select2.render({
                        placeholder: "请选择",
                        allowClear: true,
                        elem: $('#orderStatus'),
                        width: "190px"
                    });*/
                    <%--select2.render({--%>
                        <%--placeholder: "请选择",--%>
                        <%--allowClear: true,--%>
                        <%--elem: $('#productCode'),--%>
                        <%--width: "190px"--%>
                    <%--});--%>
                    <%--//初始化业务类型及产品--%>
                    <%--distpicker.render({--%>
                        <%--url: "${basePath}/rzsc/common/tree_book_list.do?code=BUS_YT_DK&type=2&level=2", // 请求地址--%>
                        <%--elem: '#typeCode', // 容器Id--%>
                        <%--type: 2,--%>
                        <%--placeholder: '选择业态',--%>
                        <%--defaultParentCode:'BUS_YT_DK',--%>
                        <%--callback:function () {//如果不需要选产品就把callback整个方法注释掉--%>
                            <%--var code = $("#typeCode .plug-in-code").val();--%>
                            <%--initProductCode("#productCode",code);--%>
                            <%--select2.render({--%>
                                <%--placeholder: "请选择",--%>
                                <%--allowClear: true,--%>
                                <%--elem: $('#productCode'),--%>
                                <%--width: "190px"--%>
                            <%--});--%>
                            <%--var produtId = $("#productCode").val();--%>
                            <%--initChannel("#channelCode",produtId);--%>
                            <%--select2.render({--%>
                                <%--placeholder: "请选择",--%>
                                <%--allowClear: true,--%>
                                <%--elem: $('#channelCode'),--%>
                                <%--width: "160px"--%>
                            <%--});--%>
                        <%--},--%>
                        <%--callbackClear:function () {--%>
                            <%--$("#productCode").find("option").remove();--%>
                            <%--$("#productCode").append("<option value=''>请选择</option>");--%>
                            <%--$("#channelCode").find("option").remove();--%>
                            <%--$("#channelCode").append("<option value=''>请选择</option>");--%>
                        <%--}--%>
                    <%--});--%>
                    <%--//渠道初始化--%>
                    <%--$('#productCode').on('change', function (e) {--%>
                        <%--var produtId = $("#productCode").val();--%>
                        <%--initChannel("#channelCode",produtId);--%>
                        <%--select2.render({--%>
                            <%--placeholder: "请选择",--%>
                            <%--allowClear: true,--%>
                            <%--elem: $('#channelCode'),--%>
                            <%--width: "190px"--%>
                        <%--});--%>
                    <%--});--%>
                    //初始化流程人员
                    initUser("RZSC_FLOW_USER","role","#flowUserId");
                    select2.render({
                        placeholder: "请选择",
                        allowClear: true,
                        elem: $('#flowUserId'),
                        width: "190px"
                    });
                    //初始化驳回人员
                    initUser("RZSC_INCHARGE_USER","role","#auditorId");
                    select2.render({
                        placeholder: "请选择",
                        allowClear: true,
                        elem: $('#auditorId'),
                        width: "190px"
                    });
                    //初始化签单商务
              /*      initUser("RZSC_SIGN_USER","role","#signUserId");
                    select2.render({
                        placeholder: "请选择",
                        allowClear: true,
                        elem: $('#signUserId'),
                        width: "190px"
                    });*/
                    //初始化退单时间
                    dggdate.render({
                        elem: '#abandonReasonTime',
                        type: 'date',
                        range: '~'
                    });
                    //初始化驳回时间
                    dggdate.render({
                        elem: '#lastRemarkTime',
                        type: 'date',
                        range: '~'
                    });
                    //初始化接单时间
              /*      dggdate.render({
                        elem: '#receiveOrderDate',
                        type: 'date',
                        range: '~'
                    });*/
                    var opt={
                        "elem":"#rejectedOrderf",
                        "ajax": rejectedOrder.list,
                        "scrollX": "true",//是否开启横项滚动
                        "switchStatus": "rejectedOrderf",
                        //"oneSelectCheck":true,//单选，同时选中复选框
                        //"destroy": "true",
                        "fixedColumns": {//锁定列，只有开启scrollX时才生效
                            "leftColumns": 4,//左侧锁定2列
                            "rightColumns": 1//右侧锁定1列
                        },
                        "fnServerParams": function (aoData) {
                            // var moneyMax = $("#moneyMax").val().trim();
                            // var moneyMin = $("#moneyMin").val().trim();
                            //搜索条件
                            //aoData = $.extend(aoData, $("#searchForm").serializeObject());
                            //aoData = $.extend(aoData, serializeObject($("#formComplete")));
                            aoData = $.extend(aoData, {
                                // customerPhone:$("#customerPhone").val(),
                                productOrgId:$("#productOrgId").val(),
                                // typeCode:$("#typeCode .plug-in-code").val(),
                                // productId:$("#productCode").val(),
                                // channelId:$("#channelCode").val(),
                                abandonReasonTime:$("#abandonReasonTime").val(),
                                lastRemarkTime:$("#lastRemarkTime").val(),
                                flowUserId:$("#flowUserId").val(),
                                auditorId:$("#auditorId").val(),
                                // signTime:$("#signTime").val(),
                                searchKey:$("#searchKey").val(),
                                completeState : $('#completeState').val(),
                                customerName:$("#customerName").val(),
                                // moneyMax:moneyMax,
                                // moneyMin:moneyMin,
                            });
                            console.log(aoData)
                            return aoData;
                        },
                        "aoColumns": [
                            {
                                "sClass": "check-th",
                                "title": '<input type="checkbox" class="checkall">',
                                "orderable": false,
                                "render": function(data, type, full, meta) {
                                    return '<input type="checkbox" class="checkchild" name="checkchild" value="' + data + '">';
                                }
                            },
                            {
                                "title": "序列号",
                                "render": function(data, type, full, meta) {
                                    return meta.row + 1;
                                }
                            },
                            {
                                "title": "所属生产事业部",
                                "data": "productOrgName",
                                "orderable": false,
                                "render": function(data, type, full, meta) {
                                    return data ? data : '';
                                }
                            },
                            {
                                "title": "订单编号",
                                "orderable": false,
                                "data": "orderNo",
                                "render": function (data, type, full, meta) {
                                    return ('<a href=\'javascript:void(0)\' class="dggui-link"  onclick="openBusinessDetail(\'' + full.orderNo + '\',\'' + full.orderId + '\')" /><span>' + data + '</span></a>');
                                    /*return data;*/
                                }
                            },
                            {
                                "title": "生产订单编号",
                                "orderable": false,
                                "data": "scProductOrderNo",
                                "render": function (data, type, full, meta) {
                                    var result = "";
                                    result += '<a href="javascript:;"  class="dggui-link" onclick="openOrderInfoDetail(\'' + full.scProductOrderNo + '\',\'' + full.id + '\')" /><span>' + data + '</span></a>';
                                    return result;
                                }
                            },
                            {
                                "title": "客户",
                                "orderable": false,
                                "data": "customerName",
                                "render": function (data, type, full, meta) {
                                    return emptyStringConvert(full.customerName) + '<p>' + emptyStringConvert(full.customerPhone) + '</p>';
                                }
                            },
                            {
                                "title":"合同编号",
                                "orderable": false,
                                "data": "contractNo",
                                "render": function (data, type, full, meta) {
                                    return data ? data : '';
                                }
                            },
                            {
                                "title":"业务类型",
                                "orderable": false,
                                "data": "businessProductName",
                                "render": function (data, type, full, meta) {
                                    return data ? data : '';
                                }
                            },
                            {
                                "title":"产品",
                                "orderable": false,
                                "data": "productName",
                                "render": function (data, type, full, meta) {
                                    return data ? data : '';
                                }
                            },
                            {
                                "title":"渠道",
                                "orderable": false,
                                "data": "channelName",
                                "render": function (data, type, full, meta) {
                                    return data ? data : '';
                                }
                            },
                            {
                                "title":"流程人员",
                                "orderable": false,
                                "data": "flowUserName",
                                "render": function (data, type, full, meta) {
                                    return data ? data+'<p>'+emptyStringConvert(full.flowUserOrgName)+'</p>': '';
                                }
                            },
                            {
                                'title': '签单时间',
                                'data': "signTime",
                                "orderable": false,
                                "render": function(data, type, row, meta) {
                                    var htm =  '<div class="order-render"><p>' + data ? data : '' + '</p></div>';
                                    return htm;
                                }
                            },
                            {
                                'title': '接单时间',
                                'data': "receiveOrderDate",
                                "orderable": false,
                                "render": function(data, type, row, meta) {
                                    var htm =  '<div class="order-render"><p>' + data ? data : '' + '</p></div>';
                                    return htm;
                                }
                            },
                            {
                                "title":"签单人/部门",
                                "orderable": false,
                                "data": "flowUserName",
                                "render": function (data, type, full, meta) {
                                    return emptyStringConvert(full.signUserName) + '<p>' + emptyStringConvert(full.signUserOrgName) + '</p>';
                                }
                            },
                            {
                                "title":"申请废单时间",
                                "orderable": false,
                                "data": "abandonReasonTime",
                                "render": function (data, type, full, meta) {
                                    return data ? data : '';
                                }
                            },
                            {
                                "title":"废单原因",
                                "orderable": false,
                                "data": "abandonReason",
                                "render": function (data, type, full, meta) {
                                    var htm ='<div class="line1" title="'+data+'"><p>' + strInterception(data,10) + '</p></div>';
                                    return htm;
                                }
                            },
                            {
                                "title":"申请人",
                                "orderable": false,
                                "data": "abandonUser",
                                "render": function (data, type, full, meta) {
                                    return data ? data : '';
                                }
                            },
                            {
                                "title":"驳回时间",
                                "orderable": false,
                                "data": "lastRemarkTime",
                                "render": function (data, type, full, meta) {
                                    return data ? data : '';
                                }
                            },
                            {
                                "title":"驳回原因",
                                "orderable": false,
                                "data": "lastRemark",
                                "render": function (data, type, full, meta) {
                                    var htm ='<div class="line1" title="'+data+'"><p>' + strInterception(data,10) + '</p></div>';
                                    return htm;
                                }
                            },
                            {
                                "title":"驳回人员",
                                "orderable": false,
                                "data": "auditorName",
                                "render": function (data, type, full, meta) {
                                    return data ? data : '';
                                }
                            },
                            {
                                "title":"需求金额（元）",
                                "orderable": false,
                                "data": "loanAmount",
                                "render": function (data, type, full, meta) {
                                    var htm = '<div class="order-render">' +
                                    '<p><span >' +data ? data : '' + '</span></p>'+
                                        '</div>'
                                    return htm;
                                }
                            },
                            {
                                "title":"订单状态",
                                "orderable": false,
                                "data": "status",
                                "render": function (data, type, full, meta) {
                                    //return data+'<p>'+full.signUserOrgName+'</p>';
                                    return data;
                                }
                            },
                            {
                                'title': '最新备注',
                                'data': "lastRemark",
                                "orderable": false,
                                "render": function (data, type, row, meta) {
                                    return '<div class="line1" title="'+data+'"><p>' + strInterception(data,10) + '</p></div>' + '<p>'+emptyStringConvert(row.lastRemarkTime)+'</p>';
                                }
                            },
                            {
                                'title': '操作',
                                "orderable": false,
                                "render": function(data, type, row, meta) {
                                    var htm = '<a href=javascript:void(0)" class="dggui-link" onclick="remarkOrder(\''+row.id+'\',$(\'#rejectedOrderf\'));">备注</a>';
                                    return htm;
                                }
                            }
                        ],
                        "columnDefs": [{
                            targets: [3], //第1，2，3列
                            createdCell: function (td, cellData, rowData, row, col) {
                                if (rowData.orderTimeStatus == timeout) {
                                    $(td).parent().addClass("red");//订单超期
                                    return;
                                } else if (rowData.nodeTimeStatus == timeout) {//节点超期
                                    $(td).parent().addClass("green");
                                    return;
                                }
                            }
                        }]
                    };
                    tables=table.render(opt);
                    // 处理dataTable 异常错误信息
                    $.fn.dataTable.ext.errMode = 'none';//不抛出异常
                    tables.on( 'error.dt', function ( e, settings, techNote, message ) {
                        //dggui.dialog.errors("表格查询错误，请联系管理员", 2000);
                       if(checkEmpty(settings.jqXHR.responseJSON.error)){dggui.dialog.errors(settings.jqXHR.responseJSON.error, 2000);}
                    });
                }
            });

        }

        function tuidan(){
            $.ajax({
                url: rejectedOrder.rejectedtd,
                dataType: 'html',
                success:function(html){
                    $("#rejectedIncloud").html(html);
                    //初始化所属生产事业部
                    syb("#productOrgId");
                    select2.render({
                        placeholder: "请选择",
                        elem: $('#productOrgId'),
                        allowClear: true,
                        width: "190px"
                    });
                    //初始化订单状态
                    /*commonTreeBookCode("#orderStatus", "RZSCORDER_STATUS", 1, 1, 1, true);
                    select2.render({
                        placeholder: "请选择",
                        allowClear: true,
                        elem: $('#orderStatus'),
                        width: "190px"
                    });*/
                    // select2.render({
                    //     placeholder: "请选择",
                    //     allowClear: true,
                    //     elem: $('#productCode'),
                    //     width: "190px"
                    // });
                    //初始化业务类型及产品
                    <%--distpicker.render({--%>
                        <%--url: "${basePath}/rzsc/common/tree_book_list.do?code=BUS_YT_DK&type=2&level=2", // 请求地址--%>
                        <%--elem: '#typeCode', // 容器Id--%>
                        <%--type: 2,--%>
                        <%--placeholder: '选择业态',--%>
                        <%--defaultParentCode:'BUS_YT_DK',--%>
                        <%--callback:function () {//如果不需要选产品就把callback整个方法注释掉--%>
                            <%--var code = $("#typeCode .plug-in-code").val();--%>
                            <%--initProductCode("#productCode",code);--%>
                            <%--select2.render({--%>
                                <%--placeholder: "请选择",--%>
                                <%--allowClear: true,--%>
                                <%--elem: $('#productCode'),--%>
                                <%--width: "190px"--%>
                            <%--});--%>
                        <%--},--%>
                        <%--callbackClear:function () {--%>
                            <%--$("#productCode").find("option").remove();--%>
                            <%--$("#productCode").append("<option value=''>请选择</option>");--%>
                            <%--$("#channelCode").find("option").remove();--%>
                            <%--$("#channelCode").append("<option value=''>请选择</option>");--%>
                        <%--}--%>
                    <%--});--%>
                    <%--//渠道初始化--%>
                    <%--$('#productCode').on('change', function (e) {--%>
                        <%--var produtId = $("#productCode").val();--%>
                        <%--initChannel("#channelCode",produtId);--%>
                        <%--select2.render({--%>
                            <%--placeholder: "请选择",--%>
                            <%--allowClear: true,--%>
                            <%--elem: $('#channelCode'),--%>
                            <%--width: "190px"--%>
                        <%--});--%>
                    <%--});--%>
                    //初始化流程人员
                    initUser("RZSC_FLOW_USER","role","#flowUserId");
                    select2.render({
                        placeholder: "请选择",
                        allowClear: true,
                        elem: $('#flowUserId'),
                        width: "190px"
                    });
                    //初始化驳回人员
                    initUser("RZSC_INCHARGE_USER","role","#auditorId");
                    select2.render({
                        placeholder: "请选择",
                        allowClear: true,
                        elem: $('#auditorId'),
                        width: "190px"
                    });
                    //初始化签单商务
                    // initUser("RZSC_SIGN_USER","role","#signUserId");
                    // select2.render({
                    //     placeholder: "请选择",
                    //     allowClear: true,
                    //     elem: $('#signUserId'),
                    //     width: "190px"
                    // });
                    //初始化退单时间
                    dggdate.render({
                        elem: '#abandonReasonTime',
                        type: 'date',
                        range: '~'
                    });
                    //初始化驳回时间
                    dggdate.render({
                        elem: '#lastRemarkTime',
                        type: 'date',
                        range: '~'
                    });
                    //初始化接单时间
                    // dggdate.render({
                    //     elem: '#receiveOrderDate',
                    //     type: 'date',
                    //     range: '~'
                    // });
                    var opt={
                        "elem":"#rejectedOrdert",
                        "ajax": rejectedOrder.list,
                        "scrollX": "true",//是否开启横项滚动
                        "switchStatus": "rejectedOrdert",
                        //"oneSelectCheck":true,//单选，同时选中复选框
                        //"destroy": "true",
                        "fixedColumns": {//锁定列，只有开启scrollX时才生效
                            "leftColumns": 4,//左侧锁定2列
                            "rightColumns": 1//右侧锁定1列
                        },
                        "fnServerParams": function (aoData) {
                            // var moneyMax = $("#moneyMax").val().trim();
                            // var moneyMin = $("#moneyMin").val().trim();
                            //搜索条件
                            //aoData = $.extend(aoData, $("#searchForm").serializeObject());
                            //aoData = $.extend(aoData, serializeObject($("#formComplete")));
                            aoData = $.extend(aoData, {
                                // customerPhone:$("#customerPhone").val(),
                                productOrgId:$("#productOrgId").val(),
                                // typeCode:$("#typeCode .plug-in-code").val(),
                                // productId:$("#productCode").val(),
                                // channelId:$("#channelCode").val(),
                                abandonReasonTime:$("#abandonReasonTime").val(),
                                lastRemarkTime:$("#lastRemarkTime").val(),
                                flowUserId:$("#flowUserId").val(),
                                auditorId:$("#auditorId").val(),
                                // signTime:$("#signTime").val(),
                                searchKey:$("#searchKey").val(),
                                completeState : $('#completeState').val(),
                                customerName:$("#customerName").val(),
                                // moneyMax:moneyMax,
                                // moneyMin:moneyMin,
                            });
                            console.log(aoData)
                            return aoData;
                        },
                        "aoColumns": [
                            {
                                "sClass": "check-th",
                                "title": '<input type="checkbox" class="checkall">',
                                "orderable": false,
                                "render": function(data, type, full, meta) {
                                    return '<input type="checkbox" class="checkchild" name="checkchild" value="' + data + '">';
                                }
                            },
                            {
                                "title": "序列号",
                                "orderable": false,
                                "render": function(data, type, full, meta) {
                                    return meta.row + 1;
                                }
                            },
                            {
                                "title": "所属生产事业部",
                                "data": "productOrgName",
                                "orderable": false,
                                "render": function(data, type, full, meta) {
                                    return data ? data : '';
                                }
                            },
                            {
                                "title": "订单编号",
                                "orderable": false,
                                "data": "orderNo",
                                "render": function (data, type, full, meta) {
                                    return ('<a href=\'javascript:void(0)\' class="dggui-link"  onclick="openBusinessDetail(\'' + full.orderNo + '\',\'' + full.orderId + '\')" /><span>' + data + '</span></a>');
                                    /* return data;*/
                                }
                            },
                            {
                                "title": "生产订单编号",
                                "orderable": false,
                                "data": "scProductOrderNo",
                                "render": function (data, type, full, meta) {
                                    var result = "";
                                    result += '<a href="javascript:;"  class="dggui-link"  onclick="openOrderInfoDetail(\'' + full.scProductOrderNo + '\',\'' + full.id + '\')" /><span>' + data + '</span></a>';
                                    return result;
                                }
                            },
                            {
                                "title": "客户",
                                "orderable": false,
                                "data": "customerName",
                                "render": function (data, type, full, meta) {
                                    return emptyStringConvert(full.customerName) + '<p>' + emptyStringConvert(full.customerPhone) + '</p>';
                                }
                            },
                            {
                                "title":"合同编号",
                                "orderable": false,
                                "data": "contractNo",
                                "render": function (data, type, full, meta) {
                                    return data ? data : '';
                                }
                            },
                            {
                                "title":"业务类型",
                                "orderable": false,
                                "data": "businessProductName",
                                "render": function (data, type, full, meta) {
                                    return data ? data : '';
                                }
                            },
                            {
                                "title":"产品",
                                "orderable": false,
                                "data": "productName",
                                "render": function (data, type, full, meta) {
                                    return data ? data : '';
                                }
                            },
                            {
                                "title":"渠道",
                                "orderable": false,
                                "data": "channelName",
                                "render": function (data, type, full, meta) {
                                    return data ? data : '';
                                }
                            },
                            {
                                "title":"流程人员",
                                "orderable": false,
                                "data": "flowUserName",
                                "render": function (data, type, full, meta) {
                                    return data ? data+'<p>'+emptyStringConvert(full.flowUserOrgName)+'</p>': '';
                                }
                            },
                            {
                                'title': '签单时间',
                                'data': "signTime",
                                "orderable": false,
                                "render": function(data, type, row, meta) {
                                    var htm =  '<div class="order-render"><p>' + data ? data : '' + '</p></div>';
                                    return htm;
                                }
                            },
                            {
                                'title': '接单时间',
                                'data': "receiveOrderDate",
                                "orderable": false,
                                "render": function(data, type, row, meta) {
                                    var htm =  '<div class="order-render"><p>' + data ? data : '' + '</p></div>';
                                    return htm;
                                }
                            },
                            {
                                "title":"签单人/部门",
                                "orderable": false,
                                "data": "flowUserName",
                                "render": function (data, type, full, meta) {
                                    return emptyStringConvert(full.signUserName) + '<p>' + emptyStringConvert(full.signUserOrgName) + '</p>';
                                }
                            },
                            {
                                "title":"申请退单时间",
                                "orderable": false,
                                "data": "abandonReasonTime",
                                "render": function (data, type, full, meta) {
                                    return data ? data : '';
                                }
                            },
                            {
                                "title":"退单原因",
                                "orderable": false,
                                "data": "abandonReason",
                                "render": function (data, type, full, meta) {
                                    var htm ='<div class="line1" title="'+data+'"><p>' + strInterception(data,10) + '</p></div>';
                                    return htm;
                                }
                            },
                            {
                                "title":"申请人",
                                "orderable": false,
                                "data": "abandonUser",//abandonReason(退单理由),returnAbandonCompleteTime(退单完成时间)
                                "render": function (data, type, full, meta) {
                                    return data ? data : '';
                                }
                            },
                            {
                                "title":"驳回时间",
                                "orderable": false,
                                "data": "lastRemarkTime",//abandonReason(退单理由),returnAbandonCompleteTime(退单完成时间)
                                "render": function (data, type, full, meta) {
                                    return data ? data : '';
                                }
                            },
                            {
                                "title":"驳回原因",
                                "orderable": false,
                                "data": "lastRemark",//abandonReason(退单理由),returnAbandonCompleteTime(退单完成时间)
                                "render": function (data, type, full, meta) {
                                    var htm ='<div class="line1" title="'+data+'"><p>' + strInterception(data,10) + '</p></div>';
                                    return htm;
                                }
                            },
                            {
                                "title":"驳回人员",
                                "orderable": false,
                                "data": "auditorName",
                                "render": function (data, type, full, meta) {
                                    return data ? data : '';
                                }
                            },
                            {
                                "title":"需求金额（元）",
                                "orderable": false,
                                "data": "loanAmount",
                                "render": function (data, type, full, meta) {
                                    var htm = '<div class="order-render">' +
                                    '<p><span >' +data ? data : '' + '</span></p>'+
                                        '</div>'
                                    return htm;
                                }
                            },
                            {
                                "title":"订单状态",
                                "orderable": false,
                                "data": "status",
                                "render": function (data, type, full, meta) {
                                    //return data+'<p>'+full.signUserOrgName+'</p>';
                                    return data;
                                }
                            },
                            {
                                'title': '最新备注',
                                'data': "lastRemark",
                                "orderable": false,
                                "render": function (data, type, row, meta) {
                                    return '<div class="line1" title="'+data+'"><p>' + strInterception(data,10) + '</p></div>' + '<p>'+emptyStringConvert(row.lastRemarkTime)+'</p>';
                                }
                            },
                            {
                                'title': '操作',
                                "orderable": false,
                                "render": function(data, type, row, meta) {
                                    var htm = '<a href=javascript:void(0)" class="dggui-link" onclick="remarkOrder(\''+row.id+'\',$(\'#rejectedOrdert\'));">备注</a>';
                                    return htm;
                                }
                            }
                        ],
                        "columnDefs": [{
                            targets: [3], //第1，2，3列
                            createdCell: function (td, cellData, rowData, row, col) {
                                if (rowData.orderTimeStatus == timeout) {
                                    $(td).parent().addClass("red");//订单超期
                                    return;
                                } else if (rowData.nodeTimeStatus == timeout) {//节点超期
                                    $(td).parent().addClass("green");
                                    return;
                                }
                            }
                        }]
                    };
                    tables = table.render(opt);
                    // 处理dataTable 异常错误信息
                    $.fn.dataTable.ext.errMode = 'none';//不抛出异常
                    tables.on( 'error.dt', function ( e, settings, techNote, message ) {
                        //dggui.dialog.errors("表格查询错误，请联系管理员", 2000);
                       if(checkEmpty(settings.jqXHR.responseJSON.error)){dggui.dialog.errors(settings.jqXHR.responseJSON.error, 2000);}
                    });
                }
            });
        }
    });

    //列表刷新
    function tableReload() {
        // var moneyMax = $("#moneyMax").val().trim();
        // var moneyMin = $("#moneyMin").val().trim();
        // if(!checkMoneySearch(moneyMin,moneyMax)){
        //     return false;
        // }
        tables.ajax.reload();
    }

    /**
     * 导出
     * */
    function excelExportRejected(url) {
        // var moneyMax = $("#moneyMax").val().trim();
        // var moneyMin = $("#moneyMin").val().trim();
        // if(!checkMoneySearch(moneyMin,moneyMax)){
        //     return;
        // }
        var obj = new Object();
        // obj.customerPhone= $("#customerPhone").val();
        obj.productOrgId= $("#productOrgId").val();
        // obj.typeCode= $("#typeCode").find(".plug-in-code").val();
        // obj.productId= $("#productCode").val();
        // obj.channelId=$("#channelCode").val();
        // obj.signTime=$("#signTime").val();
        obj.abandonReasonTime=$("#abandonReasonTime").val();
        // obj.receiveOrderDate=$("#receiveOrderDate").val();
        obj.searchKey=$("#searchKey").val();
        obj.customerName=$("#customerName").val();
        obj.lastRemarkTime = $("#lastRemarkTime").val();
        obj.flowUserId=$("#flowUserId").val();
        obj.auditorId = $("#auditorId").val();
        // obj.moneyMax=moneyMax;
        // obj.moneyMin=moneyMin;
        formSubmit(url, obj);

    }
</script>
</body>
</html>